package vip.liux.contracts.repositories.pay;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.ListCrudRepository;
import org.springframework.data.repository.ListPagingAndSortingRepository;
import org.springframework.data.repository.NoRepositoryBean;
import vip.liux.contracts.models.pay.PayApp;
import vip.liux.contracts.shared.enums.Status;

import java.time.LocalDateTime;
import java.util.List;

@NoRepositoryBean
public interface PayAppRepository extends ListPagingAndSortingRepository<PayApp, Long>, ListCrudRepository<PayApp, Long> {
    PayApp findByAppKey(String appKey);

    List<PayApp> findByIdIn(List<Long> ids);

    void updateStatusById(Long id, Status status);

    Page<PayApp> findByPageList(String appKey, String name, Status status, LocalDateTime start, LocalDateTime end, Pageable page);
}